<?php
$this->Html->addCrumb('Contact Us');
//css
echo $this->Html->css(array('tws-framework', 'jquery-ui-1.8.15.custom','jquery.cluetip'), false);
 //plugins
 echo $this->Html->script(array('plugins/jquery.validate.min','plugins/additional-methods','plugins/custom-validation-methods','plugins/jquery.maskedinput-1.3','plugins/jquery.timeentry.min','plugins/jquery-ui-1.8.15.custom.min','plugins/jquery.cluetip','plugins/jquery.hoverIntent.min','plugins/jquery.form','plugins/jquery.blockUI'), false);
 //custom plugins
 echo $this->Html->script(array('mylibs/tws_console','mylibs/tws_form','mylibs/tws_overlay'), false);

?>
<?php 
$this->Html->scriptStart(array('inline' => false));
echo '
      $(function(){
        $("#ContactIndexForm").TWS_Form( {
          validate : {
          rules : {
            ContactIntroduce : {required : true},
            ContactName : {required : true},
            ContactEmailAddress: {email : true},
            ContactPhone: {phoneUS : true},
            ContactMessage: {required : true},
            ContactCaptchaText: {required : true}
          }
          }});
        $("#ContactCaptchaReload").click(function() {
          $("#ContactCaptchaImg").attr("src", "'.$this->Html->url(array("action"=>"securimage")).'/" + Math.random());
          return false;
        }).show();

        });
       ';
$this->Html->scriptEnd();
?>



<div id="mainLeft">
  <?php echo $this->Html->image('contact.jpg', array('alt' => 'Contact Us','title'=>'Contact Us', 'class'=>'photo'))?>
</div>

<div id="sideContent">
  <p><?php echo $this->Html->image('contact-logo.png', array('alt' => 'Contact Us','title'=>'Contact Us','class'=>'plain center'))?></p>
  <h1>Contact Us</h1>
  <span class="info">for further information please contact us:</span>
  <div id="contactInfo">
    <p><span class="contactMethod">P.</span><span class="contactMethodValue"> <a href="tel:+18684789563" class="contact">+1.868.478.9563</a> </span></p>
    <p><span class="contactMethod"></span><span class="contactMethodValue"><a href="tel:+18683406046" class="contact">+1.868.340.6046</a></span></p>
    <p><span class="contactMethod">E.</span><span class="contactMethodValue"><a href="mailto:info@islevow.com" class="contact">info@islevow.com</a></span></p>
  </div>
</div>


<hr style="clear:both; border-style: dashed;"/>
<div > <span class="info">You can also send us your questions or comments by utilizing the form below.</span></div>

<?php echo $this->Session->flash();?>
<?php echo $this->Session->flash('email');
  if(!empty($email)){
    echo ($email['message']);
  }
?>

<?php echo $this->element('errors', array('errors' => isset($errors)? $errors : null)); ?>

<?php
   if(isset( $contents['Content']['info'])) {
     echo nl2br($contents['Content']['info']);
   }
?>


<div id="contactFormContainer" >

<?php
echo $this->TWSForm->create('Contact',  array(
    'inputDefaults' => array(
        'div' => array('class'=>'row')),
        'class'=>'inlineForm',
        'type'=>'file'));
echo $this->TWSForm->input('introduce', array('name'=>'ContactIntroduce', 'type'=>'select', 'label'=>'<span class="required">*</span>Introduce yourself', 'options'=>Configure::read('App.introduceYourself')));
echo $this->TWSForm->input('name', array('name'=>'ContactName', 'type'=>'text', 'label'=>'<span class="required">*</span>Name'));
echo $this->TWSForm->input('email_address', array('name'=>'ContactEmailAddress', 'type'=>'text'));
echo $this->TWSForm->input('phone', array('name'=>'ContactPhone', 'type'=>'tel'));
echo $this->TWSForm->input('subject', array('name'=>'ContactSubject', 'type'=>'text'));
echo $this->TWSForm->input('message', array('name'=>'ContactMessage', 'type'=>'textarea', 'rows'=>'6', 'label'=>'<span class="required">*</span>Message'));
?>

<div id="captcha_container">
    <img id="ContactCaptchaImg" src="<?php echo $this->Html->url(array("action"=>"securimage")); ?>/0" alt="CAPTCHA image" />
    <div><p><a href="#" id="ContactCaptchaReload">Reload Image</a></p></div>
    <p>Type the characters exactly as you see them in the image above. This ensures that a person, not an automated program, is submitting this form.</p>
    <?php echo $this->TWSForm->input('captcha_text', array('name'=>'ContactCaptchaText', 'type'=>'text', 'label'=>'<span class="required">*</span>Image characters'));?>

</div>


<?php
echo $this->TWSForm->end( array("label"=>"Submit", "class"=>"button", 'id'=>'submitBtn'));
?>
</div>